define(['model/new', 'collection/news', 'text!../../tpl/face/banner.html'], function(newModel, News, template){
    var news = new News();

    var Banner = Backbone.View.extend({

        el: '#banner-slider',

        initialize: function(options) {
            this.renderafterCallback = options.renderafterCallback;
        },

        render: function() {
            var self = this;
            var query = new Bmob.Query(newModel);
            query.equalTo("isbanner", true);
            query.find({
                success: function(results) {
                    self.template = _.template(template);
                    self.$el.html(self.template(results));
                    self.renderafterCallback && self.renderafterCallback.apply(this, arguments);
                    return self;
                },
                error: function(error) {
                    return self;
                }
            });
        }
	});
	return Banner;
});
